package reader;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author feng
 * @Date 2021/12/26 20:57
 */
public class BufferedReader_ {
    public static void main(String[] args) throws IOException {
        String filePath = "D:\\IO\\4.text";
        String read = "";
        FileReader reader = new FileReader(filePath);
        BufferedReader bufferedReader = new BufferedReader(reader);
        //读取一行数据
        while ((read = bufferedReader.readLine()) != null) {
            System.out.println(read);
        }
        //只需关闭包装流即可，底层源码FileReader
        bufferedReader.close();
    }
}
